//字符串模板
define(function(require, exports){
	exports.init = function(e){
		var container = e.detail.page.container,
			stringTmp = $$(container).find('.string-template').html();
		//编译字符串模板
		var compiledStringTemplate = Template7.compile(stringTmp);
		//上下文数据
		var stringContext = {
		    firstName: 'John',
		    lastName: 'Doe'
		};
		var stringHtml = compiledStringTemplate(stringContext);
		$$(container).find('.string-template').html(stringHtml);
		
		//循环列表模板
		var listTmp = $$(container).find('.list-template ul').html();
		var compiledListTemplate = Template7.compile(listTmp);
		var listContext = {
			'languages': [{
				name:'JavaScript',
                description: 'Dynamic computer programming language[5]. It is most commonly used as part of web browsers, whose implementations allow...'
			}, {
                name:'CSS',
                description: 'Style sheet language used for describing the look and formatting of a document written in a markup language...'
            }, {
                name: 'PHP',
                description: 'Server-side scripting language designed for web development but also used as a general-purpose programming language...'
            }, {
                name: 'Ruby',
                description: 'Dynamic, reflective, object-oriented, general-purpose programming language...'
            }]
		}
		var listHtml = compiledListTemplate(listContext);
		$$(container).find('.list-template ul').html(listHtml);
	};
});